web3.js web3.eth.submitWork
web3.eth.submitWork(nonce, powHash, digest, [callback])
プルーフオブワーク の解を提出する際に使用されます。
パラメータ
1. String
8バイト(64bit)
発見した nonce
2. String
32バイト(256bit)
ヘッダの PoW ハッシュ
3. String
32バイト(256bit)
mix digest
4. Function
オプショナル
コールバック
第一引数に error オブジェクト、第二引数に result オブジェクトが渡されます。
戻り値
Boolean を返す Promise
提出された解が有効だった場合 true
そうでない場合 false
サンプル
code:example.js
web3.eth.submitWork([
"0x0000000000000001",
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000"
])
.then(console.log);
true
参考
https://web3js.readthedocs.io/en/1.0/web3-eth.html#submitwork
関連
eth_submitWork
#web3.js #web3.js@1.0
web3.js 日本語 API リファレンス